import PropTypes from "prop-types"
import React, { memo } from "react"

import { RoomWrapper } from "./style"
import RoomItem from "../room-item"

const SectionRooms = memo((props) => {
  const { roomList = [], itemWidth } = props
  return (
    <RoomWrapper>
      {roomList?.slice(0, 8)?.map((item) => {
        // console.log(item)
        return <RoomItem itemData={item} key={item.id} itemWidth={itemWidth} />
      })}
    </RoomWrapper>
  )
})

SectionRooms.propTypes = {
  roomList: PropTypes.array,
}

export default SectionRooms
